package exodia;
/**
 * ModGames (C) 2007 Pedro Miller Rabinovitch.
 * 
 * Permission is hereby granted to copy and use this material for any free or educational purpose.
 * Please do not use this for commercial purposes before letting me know (but it'll be fine).
 * 
 * Contact me via gmail, account pedromr
 * http://exodia.org
 * 
 * $Id: AnimDefinition.java 41 2007-12-04 00:57:21Z pedromr $
 */

import javax.microedition.lcdui.Graphics;


public class AnimDefinition {
	StripDefinition strip;
	int[] sequence;
	int msFrameTime;
	
	public AnimDefinition(StripDefinition strip, int[] sequence, int msFrameTime) {
		super();
		this.strip = strip;
		this.sequence = sequence;
		this.msFrameTime = msFrameTime;
	}

	public void drawFrame(Graphics g, int x, int y, int currFrame, int transform) {		
		if( sequence != null ) {
			// set appropriate frame
			// currFrame = sequence[currFrame]...
		}
		
		strip.drawFrame( g, x, y, currFrame, transform );
	}

	public int getNumberOfFrames() {
		if( sequence != null )
			return sequence.length;
		else
			return strip.getNumberOfFrames();
	}

	public int getWidth(int currFrame) {
		return strip.frameWidth;
	}

	public int getHeight(int currFrame) {
		return strip.frameHeight;
	}
}
